import Vue from 'vue'
import Router from 'vue-router'


Vue.use(Router)
const routes = [
		{
			path:'/login',
			name:'login',
			component:()=>import('@/views/login'),
			meta:{
				'requiresAuth':false
			}
		},
		{
			path:'/',
			component:()=>import('@/views/layout'),
			children:[
				{
					path:'',//默认子路由
					name:'home',
					component:()=>import('@/views/home/home.vue'),
					meta:{
						'requiresAuth':false
					}
				},
				{
					path:'/qa',//默认子路由
					name:'qa',
					component:()=>import('@/views/qa/qa.vue'),
					meta:{
						'requiresAuth':false
					}
				},
				{
					path:'/video',//默认子路由
					name:'video',
					component:()=>import('@/views/video/'),
					meta:{
						'requiresAuth':false
					}
				},
				{
					path:'/my',//默认子路由
					name:'my',
					component:()=>import('@/views/my/my.vue'),
					meta:{
						'requiresAuth':false
					}
				}
			]
		},
		{path:'/search',name:'search',component:()=>import('@/views/search/search.vue'),meta:{'requiresAuth':false}},
		{path:'/article/:articleId',name:'article',props:true,component:()=>import('@/views/article/article.vue'),meta:{'requiresAuth':false}},
		{path:'/user/profile',name:'user-profile',component:()=>import('@/views/user-profile/profile.vue'),meta:{'requiresAuth':false}},
		{path:'/user/chat',name:'user-chat',component:()=>import('@/views/user-chat/chat.vue'),meta:{'requiresAuth':true}}
	]
const router = new Router({
	routes
})
export default router
